/*
 * $Id: Globals.java,v 1.1 2010/06/19 14:30:29 cvs Exp $
 * 
 * 文件名称：Globals.java
 * 
 * 创建日期：Mar 29, 2007
 * 
 * 版权所有：广州绿岛(www.gzld.net)
 */
package cn.org.timespace.easyframe;

import java.io.InputStream;
import java.util.Properties;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

/**
 * 公共参数定义
 * @author administrator
 *
 */
public class Globals {
	
	//	----分页参数

    public static final int PAGE_SIZE10 = 10;//每页显示10条记录

    public static final int PAGE_SIZE16 = 16;
    
    public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
	
    //~user ===================================================================
    public static final String ACL_PERMISSIONS = "acl";//操作权限
    public static final String USER_KEY = "user";   //用户
    public static final String USERS_KEY = "users";
    public static final String USERS_NUM_KEY = "users_num";
    public static final String USERS_ALL_KEY = "users_all";
    public static final String PERMISSION_USER_AUTHOR_KEY = "isUserAuthor";
    public static final String TREE_TAG_KEY = "treetag";
    public static final String FOLDER_TREETAG_KEY = "folder_treetag";
    public static final String RESOURE_CATAGORY_KEY="resourcecatagory_treetag";
    public static final String FOLDER_TREETAG_KEY1 = "folder_treetag1";
    public static final String REDIRECT_LOGIN_FORM = "redirect_login_form";
    
    //入住房
    public static final String GUSTROOM_USING_ROOM = "2";
   
    public static final String DEPT_TREELIST_KEY = "dept_treelist";
    
    public static final String PHONE_RECORD=new Globals()
    .getKeyValue("project.avipath");
    
    //住院收费单据模版文件
    public static final String LIVETEMPLEPDFPATH = "/pdffile/liveTemplate.pdf";
    //生成后的文件
    public static final String LIVENEWPDFPATH = "/pdffile/liveNew.pdf";
    //住院门诊单据模版文件
    public static final String OUTTEMPLEPDFPATH = "/pdffile/outPTemplate.pdf";
    //生成后的文件
    public static final String OUTNEWPDFPATH = "/pdffile/outPNew.pdf";
    
    //applicationContext-easyframe.xml文件相对路径
    public static final String APP_CONTEXT_PATH = "/WEB-INF/applicationContext-ons.xml" ;
    
    //hibernate的sessionFactory
    public static SessionFactory SESSION_FACTORY = null;
    
   //=================营收科目编码==================================================

    //餐饮部
    public static final String C_MEALS = "C001";						//餐费
    public static final String C_DRINKS	= "C002";						//酒水
    public static final String C_RESTAURANT_CUSTOMERS_PAY = "C003"; 	//餐饮客赔
    public static final String C_RESTAURANT_OTHER = "C004"; 			//餐饮其它
    public static final String C_RESTAURANT_COMPARTMENT = "C005"; 		//餐饮包房
    
    //多经部
    public static final String D_NIGHTCLUB = "D001";					//夜总会	
    public static final String D_BATH_CETER = "D002";					//洗浴中心
    public static final String D_LOBBY_BAR = "D003";					//大堂吧
    
    //客房部
    public static final String F_ROOM_PRICE = "F001";					//房费
    public static final String F_ROOM_COMMODITY = "F002";				//房间商品
    public static final String F_ROOM_CUSTOMERS_PAY = "F003";			//客房客赔
    
    public static final String F_MEETINGROOM = "F004";					//会议室
    public static final String F_BUSINESS = "F005";						//商务
    public static final String F_ROOM_OTHER = "F006";					//其它
    public static final String F_CHESS = "F007";						//棋牌
    public static final String F_LAUNDRY_CHARGES = "F008"; 				//洗衣费
    
    //12楼
    public static final String S_MEALS = "S001";						//12楼餐费
    public static final String S_DRINKS = "S002";						//12楼酒水
    public static final String S_CUSTOMERS_PAY = "S003";				//12楼客赔
    public static final String S_COMPARTMENT = "S004";					//12楼包房
    public static final String S_OTHER = "S005";						//12楼其它
    
    //=================营收科目编码==================================================
    
    
    /*
     * 读取属性文件,如定义好路径
     */
    public Properties loadProp() {
        InputStream is = getClass().getResourceAsStream(
                "/Copyright.properties");

        Properties dbProps = new Properties();
        try {
            dbProps.load(is);

        } catch (Exception e) {
            System.err.println("不能读取属性文件. "
                    + "请确保projectpath.properties在CLASSPATH指定的路径中");
            ;
        }
        return dbProps;
    }
    public String getKeyValue(String key) {

        Properties dbProps = this.loadProp();

        String keyValue = "";
        keyValue = dbProps.getProperty(key);

        return keyValue;

    }

    
    
}
